home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Samples / SampleCode / Plug-in - WireFrame Renderer / SR_PixmapMarkerRenderer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-14  |  15.4 KB  |  636 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        SR_PixmapMarkerRenderer.h                                 **
  4.  **                                                                          **
  5.  **                                                                          **
  6.  **     Purpose:                                                               **
  7.  **                                                                          **
  8.  **                                                                          **
  9.  **                                                                          **
  10.  **     Copyright (C) 1995-1997 Apple Computer, Inc. All rights reserved.     **
  11.  **                                                                          **
  12.  **                                                                          **
  13.  *****************************************************************************/
  14. #include "QD3D.h"
  15. #include "QD3DStorage.h"
  16.  
  17. #include "SR.h"
  18. #include "SR_Marker.h"
  19. #include "SR_Rasterizers.h"
  20.  
  21.  
  22. #undef SR_PIXELTYPE
  23.  
  24. #ifdef SR_RASTERIZE_8BITS
  25.     #define    SR_PIXELTYPE        unsigned char
  26.     #define    SR_SIZEOF_PIXEL        1
  27. #endif  /*  SR_RASTERIZE_8BITS  */
  28.  
  29.  
  30. #ifdef SR_RASTERIZE_32BITS
  31.     #define    SR_PIXELTYPE        unsigned long
  32.     #define    SR_SIZEOF_PIXEL        4
  33. #endif  /*  SR_RASTERIZE_32BITS  */
  34.  
  35.  
  36. /*===========================================================================*\
  37.  *
  38.  *    Routine:    SRPixmapMarker_Rasterize_8
  39.  *                SRPixmapMarker_Rasterize_8_WClip
  40.  *                SRPixmapMarker_Rasterize_32
  41.  *                SRPixmapMarker_Rasterize_32_WClip
  42.  *
  43.  *    Comments:    
  44.  *
  45. \*===========================================================================*/
  46.  
  47. #ifdef SR_RASTERIZE_32BITS
  48.     #ifdef SR_WIN_CLIP
  49.         TQ3Status SRPixmapMarker_Rasterize_32_WClip(
  50.     #else
  51.         TQ3Status SRPixmapMarker_Rasterize_32(
  52.     #endif  /*  SR_WIN_CLIP          */
  53. #endif  /*  SR_RASTERIZE_32BITS  */
  54.  
  55. #ifdef SR_RASTERIZE_8BITS
  56.     #ifdef SR_WIN_CLIP
  57.         TQ3Status SRPixmapMarker_Rasterize_8_WClip(
  58.     #else
  59.         TQ3Status SRPixmapMarker_Rasterize_8(
  60.     #endif  /*  SR_WIN_CLIP          */
  61. #endif  /*  SR_RASTERIZE_8BITS    */
  62.  
  63.     const TSRPrivate             *srPrivate, 
  64.     const TQ3Point3D                *pt0, 
  65.     const TSRPixmapMarkerRasterData    *pixmapMarkerRaster,
  66.     const TQ3ColorRGB                *highlightColor)
  67. {
  68.     long                rowBytes;
  69.     long                markerRowBytes;
  70.  
  71.     SR_PIXELTYPE        *cBuffer;
  72.     
  73. #ifdef SR_WIN_CLIP
  74.     long                clipX, clipY;
  75.     TQ3Bitmap            *clipMask = NULL;
  76.     unsigned long        *clipMaskPtr, clipBits, clipXMask;
  77.     unsigned long        clipMaskRowBytes;
  78.     float                upperLeftX, upperLeftY;
  79. #endif  /*  SR_WIN_CLIP  */
  80.  
  81. #ifdef SR_RASTERIZE_8BITS     
  82.     SR_PIXELTYPE        pointColor;
  83. #endif  /*  SR_RASTERIZE_8BITS  */
  84.  
  85.     long                longX, longY;
  86.     long                width  = pixmapMarkerRaster->pixmap->width  - 
  87.                                     pixmapMarkerRaster->endRowSkip,
  88.                         height = pixmapMarkerRaster->pixmap->height - 
  89.                                     (pixmapMarkerRaster->startLineSkip + 
  90.                                         pixmapMarkerRaster->endLineSkip);
  91.     unsigned long        leftOver;
  92.     unsigned char        leftOverPickIndex = 0x80;
  93.     unsigned char        *cRowPtr;
  94.     unsigned char        *markerRowPtr;
  95.     
  96.     unsigned long        *marker32ARGB;
  97.     unsigned short        *marker16ARGB;
  98.  
  99.     unsigned long        highlightMask;
  100.     
  101.     TQ3PixelType        markerPixelType;
  102.     
  103. #ifdef SR_RASTERIZE_8BITS     
  104.     unsigned long        color;
  105.     unsigned char        r8, g8, b8;
  106. #endif  /*  SR_RASTERIZE_8BITS  */
  107.  
  108.     const TQ3XDrawRegionDescriptor    *descriptor;
  109.     void                            *image;
  110.  
  111.     descriptor = srPrivate->descriptor;
  112.     image = srPrivate->image;
  113.     rowBytes = descriptor->rowBytes;
  114.     
  115.     markerPixelType = pixmapMarkerRaster->pixmap->pixelType;
  116.     
  117.     
  118.     highlightMask = 0x0;
  119.     if (highlightColor != NULL) {
  120.         highlightMask = ((long)(highlightColor->r * 255.0) << 16) | 
  121.                         ((long)(highlightColor->g * 255.0) <<  8) | 
  122.                          (long)(highlightColor->b * 255.0);
  123.     }
  124.                      
  125.  
  126. #ifdef SR_WIN_CLIP
  127.     if (Q3XDrawRegion_GetClipMask(srPrivate->drawRegion, &clipMask) == kQ3Failure) {
  128.         return (kQ3Failure);
  129.     }
  130.     if (clipMask == NULL) {
  131.         return (kQ3Failure);
  132.     }
  133.     
  134. #endif  /*  SR_WIN_CLIP  */
  135.  
  136.     markerRowBytes = pixmapMarkerRaster->pixmap->rowBytes;
  137.     
  138.     longX = (long)pt0->x;
  139.     longY = (long)pt0->y;
  140.                
  141.     cBuffer = (SR_PIXELTYPE *)((unsigned char *) image +
  142.                 (((long)longY * rowBytes) + 
  143.                     (long)longX * SR_SIZEOF_PIXEL));
  144.  
  145.  
  146. #ifdef SR_WIN_CLIP
  147.  
  148.     clipMaskRowBytes = clipMask->rowBytes;
  149.     Q3XDrawRegion_GetDeviceOffsetX(srPrivate->drawRegion, &upperLeftX);
  150.     Q3XDrawRegion_GetDeviceOffsetY(srPrivate->drawRegion, &upperLeftY);
  151.  
  152.     clipX = longX - upperLeftX;
  153.     clipY = longY - upperLeftY;
  154.     clipMaskPtr = (unsigned long *)((unsigned char *)clipMask->image +
  155.                                     (clipY * clipMaskRowBytes) + ((clipX >> 5) << 2));
  156.     clipBits = *clipMaskPtr;
  157.     clipXMask = (unsigned long)(1 << (0x1F - (clipX & 0x1F)));
  158.      
  159. #endif  /*  SR_WIN_CLIP  */
  160.  
  161.     cRowPtr = (unsigned char *)cBuffer;
  162.     
  163.     {
  164.         /*
  165.          *  Get image from pixmap storage 
  166.          */
  167.         unsigned long size;
  168.         
  169.         if (pixmapMarkerRaster->pixmap->image != NULL) {
  170.             Q3MemoryStorage_GetBuffer(
  171.                 pixmapMarkerRaster->pixmap->image, 
  172.                 &markerRowPtr, 
  173.                 &size,
  174.                 NULL);
  175.         } else {
  176.             return (kQ3Failure);
  177.         }
  178.     }
  179.     
  180.     leftOver = width & 0x00000007;
  181.     width   -= leftOver;
  182.  
  183.     /* 
  184.      *  This is true if the marker is clipped on the top 
  185.      */
  186.     if (pixmapMarkerRaster->startLineSkip) {
  187.         markerRowPtr += pixmapMarkerRaster->startLineSkip * markerRowBytes;
  188.     }
  189.     
  190.     /*
  191.      *  This is true if the marker is clipped on the left 
  192.      */
  193.     if (pixmapMarkerRaster->startRowSkip) {
  194.         width -= pixmapMarkerRaster->startRowSkip;
  195.         
  196.         if (markerPixelType == kQ3PixelTypeRGB32 ||
  197.             markerPixelType == kQ3PixelTypeARGB32) {
  198.             markerRowPtr += (pixmapMarkerRaster->startRowSkip << 2);
  199.         } else if (markerPixelType == kQ3PixelTypeRGB16 ||
  200.                    markerPixelType == kQ3PixelTypeARGB16) {
  201.             markerRowPtr += (pixmapMarkerRaster->startRowSkip << 1);
  202.         }
  203.  
  204.         if (width < 0) {
  205.             leftOver += width;
  206.             leftOverPickIndex >>= -width;
  207.         }
  208.     }
  209.  
  210.     do {
  211.         long            scanWidth, scanLeftOver;
  212.         unsigned char     pickIndex = 0x80 >> (pixmapMarkerRaster->startRowSkip & 0x7);
  213.  
  214.         cBuffer = (SR_PIXELTYPE *)cRowPtr;
  215.         
  216.         if (markerPixelType == kQ3PixelTypeRGB32 ||
  217.             markerPixelType == kQ3PixelTypeARGB32) {
  218.             marker32ARGB = (unsigned long *)markerRowPtr;
  219.         }
  220.         if (markerPixelType == kQ3PixelTypeRGB16 ||
  221.             markerPixelType == kQ3PixelTypeARGB16) {
  222.             marker16ARGB = (unsigned short *)markerRowPtr;
  223.         }
  224.  
  225.         scanWidth = width;
  226.         
  227.         if (scanWidth > 0) {
  228.             do {
  229.                 do {
  230.                     if ((1)
  231. #ifdef SR_WIN_CLIP
  232.                         && (clipBits & clipXMask)
  233. #endif  /*  SR_WIN_CLIP  */
  234.                        ) {
  235.  
  236. #ifdef SR_RASTERIZE_32BITS
  237.                     
  238.                         if (markerPixelType == kQ3PixelTypeARGB32) {
  239.                             if ((*marker32ARGB & 0xFF000000) == 0) {
  240.                                 /* 
  241.                                  *  If alpha is not set don't turn on the pixel 
  242.                                  */
  243.                             } else {
  244.                                 if (highlightColor == NULL) {
  245.                                     *cBuffer = *marker32ARGB;
  246.                                 } else {
  247.                                     *cBuffer = highlightMask | (*marker32ARGB & 0xFF000000);
  248.                                 }
  249.                             }
  250.                                 
  251.                             marker32ARGB++;
  252.                         } else if (markerPixelType == kQ3PixelTypeRGB32) {
  253.                             if (highlightColor == NULL) {
  254.                                 *cBuffer = *marker32ARGB | 0xFF000000;
  255.                             } else {
  256.                                 *cBuffer = highlightMask | 0xFF000000;
  257.                             }
  258.                                 
  259.                             marker32ARGB++;
  260.                         } else if (markerPixelType ==  kQ3PixelTypeARGB16) {
  261.                             if ((*marker16ARGB & 0x8000) == 0)  {
  262.                                 /* 
  263.                                  *  If alpha is not set don't turn on the pixel 
  264.                                  */
  265.                             } else {
  266.                                 if (highlightColor == NULL) {
  267.                                     /* scale 16 to 32 */
  268.                                     unsigned short r, g, b;
  269.                                     
  270.                                     r = ((*marker16ARGB >> 10) & 0x1F) << 3;
  271.                                     g = ((*marker16ARGB >>  5) & 0x1F) << 3;
  272.                                     b = ((*marker16ARGB >>  0) & 0x1F) << 3;
  273.                                     
  274.                                     /*
  275.                                      *  Set the r, g, and b
  276.                                      */
  277.                                     *cBuffer = ((r << 16) | (g << 8) | b) | 0xFF000000;
  278.                                 } else {
  279.                                     *cBuffer = highlightMask | 0xFF000000;
  280.                                 } 
  281.                             }    
  282.                             marker16ARGB++;
  283.                         } else if (markerPixelType == kQ3PixelTypeRGB16) {
  284.                             if (highlightColor == NULL) {
  285.                                 /* scale 16 to 32 */
  286.                                 unsigned short r, g, b;
  287.                                 
  288.                                 r = ((*marker16ARGB >> 10) & 0x1F) << 3;
  289.                                 g = ((*marker16ARGB >>  5) & 0x1F) << 3;
  290.                                 b = ((*marker16ARGB >>  0) & 0x1F) << 3;
  291.                                 
  292.                                 *cBuffer = ((r << 16) | (g << 8) | b) | 0xFF000000;
  293.                             } else {
  294.                                 *cBuffer = highlightMask | 0xFF000000;
  295.                             } 
  296.                             marker16ARGB++;
  297.                         }
  298.  
  299. #endif  /*  SR_RASTERIZE_32BITS  */
  300.  
  301.  
  302. #ifdef SR_RASTERIZE_8BITS                
  303.                         pointColor = *cBuffer;
  304.  
  305.                         if (markerPixelType == kQ3PixelTypeRGB32) {
  306.                             if (highlightColor == NULL) {
  307.                                 color = *marker32ARGB;
  308.                             } else {
  309.                                 color = highlightMask;
  310.                             }
  311.                                 
  312.                             r8 = (color >> 16) & 0xFF;
  313.                             g8 = (color >>  8) & 0xFF;
  314.                             b8 = (color >>  0) & 0xFF;
  315.         
  316.                             COLOR_8_TO_INDEX(
  317.                                 pointColor,
  318.                                 srPrivate->drawRegion,
  319.                                 descriptor->pixelType,
  320.                                 r8,
  321.                                 g8, 
  322.                                 b8);
  323.                                 
  324.                             marker32ARGB++;
  325.                         } else if (markerPixelType == kQ3PixelTypeARGB32) {
  326.                             if ((*marker32ARGB & 0xFF000000) == 0) {
  327.                                 /* 
  328.                                  *  If alpha is not set don't turn on the pixel 
  329.                                  */
  330.                             } else {
  331.                                 if (highlightColor == NULL) {
  332.                                     color = *marker32ARGB;
  333.                                 } else {
  334.                                     color = highlightMask;
  335.                                 }
  336.                                     
  337.                                 r8 = (color >> 16) & 0xFF;
  338.                                 g8 = (color >>  8) & 0xFF;
  339.                                 b8 = (color >>  0) & 0xFF;
  340.             
  341.                                 COLOR_8_TO_INDEX(
  342.                                     pointColor,
  343.                                     srPrivate->drawRegion,
  344.                                     descriptor->pixelType,
  345.                                     r8,
  346.                                     g8, 
  347.                                     b8);
  348.                             }
  349.                             marker32ARGB++;
  350.                         } else if (markerPixelType == kQ3PixelTypeRGB16) {
  351.                             if (highlightColor == NULL) {
  352.                                 color = *marker16ARGB;
  353.                                 
  354.                                 r8 = (color >> 10) & 0x1F;
  355.                                 g8 = (color >>  5) & 0x1F;
  356.                                 b8 = (color >>  0) & 0x1F;
  357.                             } else {
  358.                                 color = highlightMask;
  359.                                 
  360.                                 r8 = (color >> 16) & 0xFF;
  361.                                 g8 = (color >>  8) & 0xFF;
  362.                                 b8 = (color >>  0) & 0xFF;
  363.                             }
  364.                                 
  365.                             COLOR_5_TO_INDEX(
  366.                                 pointColor,
  367.                                 srPrivate->drawRegion,
  368.                                 descriptor->pixelType,
  369.                                 r8,
  370.                                 g8, 
  371.                                 b8);
  372.                             
  373.                             marker16ARGB++;
  374.                         } else if (markerPixelType == kQ3PixelTypeARGB16) {
  375.                             if ((*marker16ARGB & 0x8000) == 0) {
  376.                                 /* 
  377.                                  *  If alpha is not set don't turn on the pixel 
  378.                                  */
  379.                             } else {    
  380.                                 if (highlightColor == NULL) {
  381.                                     color = *marker16ARGB;
  382.                                     
  383.                                     r8 = (color >> 10) & 0x1F;
  384.                                     g8 = (color >>  5) & 0x1F;
  385.                                     b8 = (color >>  0) & 0x1F;
  386.                                 } else {
  387.                                     color = highlightMask;
  388.                                     
  389.                                     r8 = (color >> 16) & 0xFF;
  390.                                     g8 = (color >>  8) & 0xFF;
  391.                                     b8 = (color >>  0) & 0xFF;
  392.                                 }
  393.                                     
  394.                                 COLOR_5_TO_INDEX(
  395.                                     pointColor,
  396.                                     srPrivate->drawRegion,
  397.                                     descriptor->pixelType,
  398.                                     r8,
  399.                                     g8, 
  400.                                     b8);
  401.                             }
  402.                             
  403.                             marker16ARGB++;
  404.                         }
  405.                         
  406.                         *cBuffer = pointColor;
  407.                         
  408. #endif  /*  SR_RASTERIZE_8BITS  */
  409.                         cBuffer++;
  410.                     }
  411.  
  412. #ifdef SR_WIN_CLIP
  413.                     clipXMask >>= 1;
  414.                     if (clipXMask == 0) {
  415.                         clipMaskPtr++;
  416.                         clipXMask = (unsigned long)(1 << 0x1F);
  417.                         clipBits = *clipMaskPtr;
  418.                     }
  419. #endif  /*  SR_WIN_CLIP  */
  420.  
  421.                 } while( pickIndex >>= 1);
  422.                 
  423.                 pickIndex = 0x80;
  424.             } while ((scanWidth -= 8) > 0);
  425.         }
  426.         
  427.         scanLeftOver     = leftOver;
  428.         pickIndex         = leftOverPickIndex;
  429.         
  430.         if (scanLeftOver > 0) {
  431.             do {
  432.                 if ((1) 
  433. #ifdef SR_WIN_CLIP
  434.                     && (clipBits & clipXMask)
  435. #endif  /*  SR_WIN_CLIP  */
  436.                     ){
  437.  
  438. #ifdef SR_RASTERIZE_32BITS
  439.                 
  440.                     if (markerPixelType == kQ3PixelTypeARGB32) {
  441.                         if ((*marker32ARGB & 0xFF000000) == 0) {
  442.                             /* 
  443.                              *  If alpha is not set don't turn on the pixel 
  444.                              */
  445.                         } else {
  446.                             if (highlightColor == NULL) {
  447.                                 *cBuffer = *marker32ARGB;
  448.                             } else {
  449.                                 *cBuffer = highlightMask | (*marker32ARGB & 0xFF000000);
  450.                             }
  451.                         }
  452.                             
  453.                         marker32ARGB++;
  454.                     } else if (markerPixelType == kQ3PixelTypeRGB32) {
  455.                         if (highlightColor == NULL) {
  456.                             *cBuffer = *marker32ARGB | 0xFF000000;
  457.                         } else {
  458.                             *cBuffer = highlightMask | 0xFF000000;
  459.                         }
  460.                             
  461.                         marker32ARGB++;
  462.                     } else if (markerPixelType ==  kQ3PixelTypeARGB16) {
  463.                         if ((*marker16ARGB & 0x8000) == 0)  {
  464.                             /* 
  465.                              *  If alpha is not set don't turn on the pixel 
  466.                              */
  467.                         } else {
  468.                             if (highlightColor == NULL) {
  469.                                 /* scale 16 to 32 */
  470.                                 unsigned short r, g, b;
  471.                                 
  472.                                 r = ((*marker16ARGB >> 10) & 0x1F) << 3;
  473.                                 g = ((*marker16ARGB >>  5) & 0x1F) << 3;
  474.                                 b = ((*marker16ARGB >>  0) & 0x1F) << 3;
  475.                                 
  476.                                 /*
  477.                                  *  Set the r, g, and b
  478.                                  */
  479.                                 *cBuffer = ((r << 16) | (g << 8) | b) | 0xFF000000;
  480.                             } else {
  481.                                 *cBuffer = highlightMask | 0xFF000000;
  482.                             } 
  483.                         }    
  484.                         marker16ARGB++;
  485.                     } else if (markerPixelType == kQ3PixelTypeRGB16) {
  486.                         if (highlightColor == NULL) {
  487.                             /* scale 16 to 32 */
  488.                             unsigned short r, g, b;
  489.                             
  490.                             r = ((*marker16ARGB >> 10) & 0x1F) << 3;
  491.                             g = ((*marker16ARGB >>  5) & 0x1F) << 3;
  492.                             b = ((*marker16ARGB >>  0) & 0x1F) << 3;
  493.                             
  494.                             *cBuffer = ((r << 16) | (g << 8) | b) | 0xFF000000;
  495.                         } else {
  496.                             *cBuffer = highlightMask | 0xFF000000;
  497.                         } 
  498.                         marker16ARGB++;
  499.                     }
  500.  
  501. #endif  /*  SR_RASTERIZE_32BITS  */
  502.  
  503.  
  504. #ifdef SR_RASTERIZE_8BITS                
  505.                     pointColor = *cBuffer;
  506.  
  507.                     if (markerPixelType == kQ3PixelTypeRGB32) {
  508.                         if (highlightColor == NULL) {
  509.                             color = *marker32ARGB;
  510.                         } else {
  511.                             color = highlightMask;
  512.                         }
  513.                             
  514.                         r8 = (color >> 16) & 0xFF;
  515.                         g8 = (color >>  8) & 0xFF;
  516.                         b8 = (color >>  0) & 0xFF;
  517.     
  518.                         COLOR_8_TO_INDEX(
  519.                             pointColor,
  520.                             srPrivate->drawRegion,
  521.                             descriptor->pixelType,
  522.                             r8,
  523.                             g8, 
  524.                             b8);
  525.                             
  526.                         marker32ARGB++;
  527.                     } else if (markerPixelType == kQ3PixelTypeARGB32) {
  528.                         if ((*marker32ARGB & 0xFF000000) == 0) {
  529.                             /* 
  530.                              *  If alpha is not set don't turn on the pixel 
  531.                              */
  532.                         } else {
  533.                             if (highlightColor == NULL) {
  534.                                 color = *marker32ARGB;
  535.                             } else {
  536.                                 color = highlightMask;
  537.                             }
  538.                                 
  539.                             r8 = (color >> 16) & 0xFF;
  540.                             g8 = (color >>  8) & 0xFF;
  541.                             b8 = (color >>  0) & 0xFF;
  542.         
  543.                             COLOR_8_TO_INDEX(
  544.                                 pointColor,
  545.                                 srPrivate->drawRegion,
  546.                                 descriptor->pixelType,
  547.                                 r8,
  548.                                 g8, 
  549.                                 b8);
  550.                         }
  551.                         marker32ARGB++;
  552.                     } else if (markerPixelType == kQ3PixelTypeRGB16) {
  553.                         if (highlightColor == NULL) {
  554.                             color = *marker16ARGB;
  555.                             
  556.                             r8 = (color >> 10) & 0x1F;
  557.                             g8 = (color >>  5) & 0x1F;
  558.                             b8 = (color >>  0) & 0x1F;
  559.                         } else {
  560.                             color = highlightMask;
  561.                             
  562.                             r8 = (color >> 16) & 0xFF;
  563.                             g8 = (color >>  8) & 0xFF;
  564.                             b8 = (color >>  0) & 0xFF;
  565.                         }
  566.     
  567.                         COLOR_5_TO_INDEX(
  568.                             pointColor,
  569.                             srPrivate->drawRegion,
  570.                             descriptor->pixelType,
  571.                             r8,
  572.                             g8, 
  573.                             b8);
  574.                         
  575.                         marker16ARGB++;
  576.                     } else if (markerPixelType == kQ3PixelTypeARGB16) {
  577.                         if ((*marker16ARGB & 0x8000) == 0) {
  578.                             /* 
  579.                              *  If alpha is not set don't turn on the pixel 
  580.                              */
  581.                         } else {    
  582.                         
  583.                             if (highlightColor == NULL) {
  584.                                 color = *marker16ARGB;
  585.                                 
  586.                                 r8 = (color >> 10) & 0x1F;
  587.                                 g8 = (color >>  5) & 0x1F;
  588.                                 b8 = (color >>  0) & 0x1F;
  589.                             } else {
  590.                                 color = highlightMask;
  591.                                 
  592.                                 r8 = (color >> 16) & 0xFF;
  593.                                 g8 = (color >>  8) & 0xFF;
  594.                                 b8 = (color >>  0) & 0xFF;
  595.                             }
  596.         
  597.                             COLOR_5_TO_INDEX(
  598.                                 pointColor,
  599.                                 srPrivate->drawRegion,
  600.                                 descriptor->pixelType,
  601.                                 r8,
  602.                                 g8, 
  603.                                 b8);
  604.                         }
  605.                         
  606.                         marker16ARGB++;
  607.                     }
  608.                     
  609.                     *cBuffer = pointColor;
  610.                         
  611. #endif  /*  SR_RASTERIZE_8BITS  */
  612.  
  613.                     cBuffer++;
  614.                 }
  615.                 
  616. #ifdef SR_WIN_CLIP
  617.                 clipXMask >>= 1;
  618.                 if (clipXMask == 0) {
  619.                     clipMaskPtr++;
  620.                     clipXMask = (unsigned long)(1 << 0x1F);
  621.                     clipBits = *clipMaskPtr;
  622.                 }
  623. #endif  /*  SR_WIN_CLIP  */
  624.  
  625.                 pickIndex >>= 1;
  626.             } while (--scanLeftOver && pickIndex);
  627.         }
  628.  
  629.         markerRowPtr += markerRowBytes;
  630.         cRowPtr      += rowBytes;
  631.         
  632.     } while (--height);
  633.     
  634.     return (kQ3Success);
  635. }
  636.